<?php

namespace app\api\validate;

use think\Validate;
/**
 *
 * 未完成
 */
class AfterSalesScene extends Validate
{
    protected $rule = [
        'id' => ["require","number"],
//        'service_name' => ['require','length'=>'1,10'],
//        "telephone" => ['regex'=>'/^1[3-9]{1}[0-9]{9}$/','require'],
//        "username" => ['number','require'],
//        "express_content" => ['require'],
//        "goods_class" => ['number','require'],
//        "num" => ['number','require'],
//        "express_name" => ['require'],
//        "unpack_time" => ['number','require'],
//        "express_code" => ['number','require'],
//        "is_notify" => ['number','require'],
//        "data_state" => ['number','require'],
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
//        'service_name.require' => '客服经理姓名不能为空',
//        'service_name.length' => '客服经理姓名长度为1-10个字符',
//        'telephone.require' => '客服经理电话号码不能为空',
//        'telephone.regex' => '电话号码格式不正确',
//        'username.require' => '客户名称不能为空',
//        'username.length' => '客户名称长度为1-10个字符',
//        'express_name.require' => '快递公司不能为空',
//        'express_name.length' => '快递公司名称长度为1-10个字符',
//        'express_content.require' => '快递内容不能为空',
//        'unpack_time.require' => '拆包时间不能为空',
//        'express_code.require' => '快递单号不能为空',
//        'num.require' => '数量不能为空',
//        'num.number' => '数量只能为数值',
        'id.require' => '分类ID不能为空',
        'id.number' => '分类ID只能为数值',
//        'goods_class.require' => '产品分类ID不能为空',
//        'goods_class.number' => '产品分类ID只能为数值',
        'data_state.number' =>'数据状态必须为数值',
        'data_state.require' =>'未设置状态',
        'is_notify.number' =>'是否通知必须为数值',
        'is_notify.require' =>'未设置是否通知',
    ];

    protected $scene = [
        'add'  =>  ['service_name','telephone','username','express_name','express_content','unpack_time','express_code','num','goods_class','is_notify'],
        'update'  =>  ['id','service_name','telephone','username','express_name','express_content','unpack_time','express_code','num','goods_class','is_notify'],
        'update_state' => ['id',"data_state"],
        'update_is_notify' => ['id','is_notify']
    ];
}

